<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
</head>
<body>

<div class="easyui-tabs" style="width:100%;height:100%">
    <div title="用户管理" style="padding:2px">
        <table id="dg_adminuser" style="width:100%;height:100%">

        </table>
        <div id="toolbar_adminuser">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newAdminUser()" th:if="${session.onlineUserPower<3}">新增</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editAdminUser()" th:if="${session.onlineUserPower<3}">编辑</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="deleteAdminUser()" th:if="${session.onlineUserPower<2}">删除</a>
        </div>
        <div id="dg_add_edit_adminuser" class="easyui-dialog" style="width:400px"
             data-options="closed:true,modal:true,border:'thin',buttons:'#dlg_buttons_user'">
            <form id="fm_add_edit_adminuser" method="post" novalidate style="margin:0;padding:20px 50px">
                <input id="adminid" name="adminid" type="text"  class="easyui-textbox" data-options="cls:'hidden_textbox'">
                <h3 style="text-align: center;">管理员信息</h3>
                <div style="margin-bottom:10px">
                    <input name="adminLoginName" id="adminLoginName" class="easyui-textbox"
                           data-options="required:true,missingMessage:'请填写管理员登录名'" label="管理员登录名:" style="width:100%">
                </div>
                <div style="margin-bottom:10px">
                    <input name="adminPassword" class="easyui-textbox" data-options="required:true,missingMessage:'请填写管理员登录密码'"
                           label="登陆密码:" style="width:100%">
                </div>
                <div style="margin-bottom:10px">
                    <input name="adminTrueName" class="easyui-textbox" data-options="required:true,missingMessage:'请填写真实姓名'"
                           label="真实姓名:" style="width:100%">
                </div>
                <div style="margin-bottom:10px">
                    <input name="power" id="power" class="easyui-textbox" label="权限:" style="width:100%"
                           data-options="required:true,missingMessage:'0-系统 1-教务 2-教务(只能查看) 3-年级主任 4-学科组长'" >
                </div>
                <div style="margin-bottom:10px">
                    <select class="easyui-combobox" name="gradeName" label="年级主任所在年级:" labelWidth="160px"
                            data-options="editable:false,missingMessage:'请选择任教年级'" style="width:380px;" autocomplete="off">
                        <option value="">无</option>
                        <option th:each="grade : ${session.grades}"  th:value="${grade.gradeName}" th:text="${grade.gradeName}"></option>
                    </select>

                </div>

            </form>
        </div>
        <div id="dlg_buttons_user">
            <a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="saveAdminUser()" style="width:90px">保存</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dg_add_edit_adminuser').dialog('close')" style="width:90px">取消</a>
        </div>
    </div>
    <div title="教师管理" style="padding:2px">
        <table id="dg_teacher" style="width:100%;height:100%">

        </table>
        <div id="toolbar">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newTeacher()" th:if="${session.onlineUserPower<3}">新增</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editTeacher()" th:if="${session.onlineUserPower<3}">编辑</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="deleteTeacher()" th:if="${session.onlineUserPower<2}">删除</a>
            <input id="teacherName" name="teacherName" class="easyui-textbox" style="width:110px" data-options="prompt:'输入教师姓名'">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="doSearchTeacher()">搜索</a>
        </div>
        <div id="dg_add_editTeacher" class="easyui-dialog" style="width:400px"
             data-options="closed:true,modal:true,border:'thin',buttons:'#dlg-buttons'">
            <form id="fm_add_editTeacher" method="post" novalidate style="margin:0;padding:20px 50px">
                <h3 style="text-align: center;">教师信息</h3>
                <div style="margin-bottom:10px">
                    <input name="teacherIdCard" id="teacherIdCard" class="easyui-textbox"
                           data-options="required:true,missingMessage:'请填写身份证号'" label="身份证号:" style="width:100%">
                </div>
                <div style="margin-bottom:10px">
                    <input name="teacherName" class="easyui-textbox" data-options="required:true,missingMessage:'请填写姓名'"
                           label="姓名:" style="width:100%">
                </div>
                <div style="margin-bottom:10px">
                    <input name="gender" class="easyui-textbox" label="性别:" style="width:100%">
                </div>
                <div style="margin-bottom:10px">
                    <input name="phone" class="easyui-textbox" label="电话:" style="width:100%">
                </div>
                <div style="margin-bottom:10px">
                    <input name="password" class="easyui-textbox" data-options="required:true,missingMessage:'请填写登录密码'"
                           label="登陆密码:" style="width:100%">
                </div>
                <div style="margin-bottom:10px">
                    <input name="roleName" id="rolenameid" class="easyui-textbox" label="角色:" style="width:100%">
                </div>
            </form>
        </div>
        <div id="dlg-buttons">
            <a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="saveTeacher()" style="width:90px">保存</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dg_add_editTeacher').dialog('close')" style="width:90px">取消</a>
        </div>
    </div>
    <div title="任教管理" style="padding:2px">
        <table id="dg_teach" style="width:100%;height:100%">

        </table>
        <div id="toolbar_teach">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newTeachInfo()" th:if="${session.onlineUserPower<3}">新增</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editTeachInfo()" th:if="${session.onlineUserPower<3}">编辑</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="deleteTeachInfo()" th:if="${session.onlineUserPower<2}">删除</a>
            <input id="teachTeacherName" name="teacherName" class="easyui-textbox" style="width:110px" data-options="prompt:'输入教师姓名'">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="doSearchTeachInfo()">搜索</a>
        </div>
        <div id="dg_add_editTeachInfo" class="easyui-dialog" style="width:400px" data-options="closed:true,modal:true,border:'thin',buttons:'#dlg-teachInfo-buttons'">
            <form id="fm_add_editTeachInfo" method="post" novalidate style="margin:0;padding:20px 50px">
                    <input type="text" hidden name="teachId">
                <h3 style="text-align: center;">教师任教信息</h3>
                <div style="margin-bottom:10px">
                    <input name="teacherIdCard" id="teachTeacherIdCard" class="easyui-textbox"
                           data-options="required:true,missingMessage:'请填写教师身份证号'" label="教师身份证号:" style="width:100%">
                </div>
                <div style="margin-bottom:10px">
                    <input name="teacherName" class="easyui-textbox" data-options="required:true,missingMessage:'请填写教师姓名'"
                           label="教师姓名:" style="width:100%">
                </div>
                <div style="margin-bottom:10px">
                    <select class="easyui-combobox" name="gradeName" label="选择任教年级:"
                            data-options="required:true,editable:false,missingMessage:'请选择任教年级'" style="width:295px;" autocomplete="off">
                        <option th:each="grade : ${session.grades}"  th:value="${grade.gradeName}" th:text="${grade.gradeName}"></option>
                    </select>
                </div>
                <div style="margin-bottom:10px">
                    <select class="easyui-combobox" name="semesterName" label="选择任教学期:" data-options="required:true,editable:false,missingMessage:'请选择任教学期'" style="width:295px;" autocomplete="off">
                        <option th:each="semester : ${session.semesters}"  th:value="${semester.semesterName}" th:text="${semester.semesterName}"></option>
                    </select>
                </div>
                <div style="margin-bottom:10px">
                    <select class="easyui-combobox" name="teamName" label="选择任教班级:" data-options="required:true,editable:false,missingMessage:'请选择任教班级'" style="width:295px;" autocomplete="off">
                        <option th:each="team : ${session.teamsList}"  th:value="${team.teamName}" th:text="${team.teamName}"></option>
                    </select>
                </div>
                <div style="margin-bottom:10px">
                    <select class="easyui-combobox" id="courseEnName" name="courseEnName" label="选择任教学科:" data-options="required:true,editable:false,missingMessage:'请选择任教学科'" style="width:295px;" autocomplete="off">
                        <option th:each="course : ${session.courses}"  th:value="${course.courseEnName}" th:text="${course.courseChName}"></option>
                    </select>
                </div>
                <div style="margin-bottom:10px">
                    <select class="easyui-combobox" name="isVariant" label="是否班主任:" data-options="editable:false,missingMessage:'请选择是否班主任'" style="width:295px;" autocomplete="off">
                        <option value="是">是</option>
                        <option value="否" >否</option>
                    </select>
                </div>
            </form>
        </div>

        <div id="dlg-teachInfo-buttons">
            <a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="saveTeach()" style="width:90px">保存</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dg_add_editTeachInfo').dialog('close')" style="width:90px">取消</a>
        </div>
    </div>
    <div title="考试管理" style="padding:2px">
        <table id="dg_exam" style="width:100%;height:100%">

        </table>
        <div id="toolbar_exam">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newExam()" th:if="${session.onlineUserPower<3}">新增</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editExam()" th:if="${session.onlineUserPower<3}">编辑</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="deleteExam()" th:if="${session.onlineUserPower<2}">删除</a>
        </div>
        <div id="dg_add_edit_exam" class="easyui-dialog" style="width:800px" data-options="closed:true,modal:true,border:'thin',buttons:'#dlg_exam_buttons'">
            <form id="fm_add_edit_exam" method="post" novalidate style="margin:0;padding:20px 50px">
                <h3 style="text-align: center;">考试信息</h3>
                <input type="text" name="examId" hidden="hidden">
                <div style="margin-bottom:10px">
                    <label for="examGradeName">年级</label>
                    <select id="examGradeName" name="gradeName"  class="easyui-combobox" style="width: 100%;height: 30px;" data-options="required:true,editable:false,missingMessage:'请选择年级'">
                        <option th:each="grade : ${session.grades}"  th:value="${grade.gradeName}" th:text="${grade.gradeName}"></option>
                    </select>
                </div>
                <div style="margin-bottom:10px">
                    <label for="examSemesterName">学期</label>
                    <select id="examSemesterName" name="semesterName"  class="easyui-combobox" style="width: 100%;height: 30px;" data-options="required:true,missingMessage:'请选择学期',editable:false">
                        <option th:each="semester : ${session.semesters}"  th:value="${semester.semesterName}" th:text="${semester.semesterName}"></option>
                    </select>
                </div>
                <div style="margin-bottom:10px">
                    <div style="margin-bottom:10px">
                        <input class="easyui-textbox" name="examName" label="考试名称:" style="width:780px;" autocomplete="off" data-options="required:true,missingMessage:'请填写考试名称'">
                    </div>
                </div>
                <div style="margin-bottom:10px">
                    <input id="courseName" name="courseName"   class="easyui-textbox" data-options="required:true,missingMessage:'请填写考试科目'"
                           label="考试科目:" style="width:780px;">
                </div>
                <div style="margin-bottom:10px">
                    <input id="examExamScore" class="easyui-textbox" name="examScore" label="考试科目总分:" style="width:780px;" autocomplete="off">
                </div>
            </form>
        </div>
        <div id="dlg_exam_buttons">
            <a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="saveExam()" style="width:90px">保存</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dg_add_edit_exam').dialog('close')" style="width:90px">取消</a>
        </div>
    </div>
    <div title="年级管理" style="padding:2px">
        <table id="dg_grade" style="width:100%;height:100%">

        </table>
        <div id="toolbar_grade">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newGrade()" th:if="${session.onlineUserPower<3}">新增</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editGrade()" th:if="${session.onlineUserPower<3}">编辑</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="deleteGrade()" th:if="${session.onlineUserPower<2}">删除</a>
        </div>
        <div id="dg_add_edit_grade" class="easyui-dialog" style="width:400px" data-options="closed:true,modal:true,border:'thin',buttons:'#dlg_buttons_grade'">
            <form id="fm_add_edit_grade" method="post" novalidate style="margin:0;padding:20px 50px">
                <h3 style="text-align: center;">年级信息</h3>
                <input type="text" name="gradeId" hidden="hidden">
                <div style="margin-bottom:10px">
                    <input name="gradeName"  class="easyui-textbox" id="addGradeName"
                           data-options="required:true,missingMessage:'请输入年级名称 如：高2024级 或 初2024级'" label="年级名称:" style="width:100%">
                </div>
                <input name="gradeDatatableName" id="gradeDatatableName" type="text" value="" hidden="hidden">
            </form>
        </div>
        <div id="dlg_buttons_grade">
            <a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="saveGrade()" style="width:90px">保存</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dg_add_edit_grade').dialog('close')" style="width:90px">取消</a>
        </div>
    </div>
    <div title="统计参数管理" style="padding:2px">
        <table id="dg_statisticsParamiter" style="width:100%;height:100%">

        </table>
        <div id="toolbar_statisticsParamiter">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newStatisticsParamiter()">新增</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editStatisticsParamiter()">编辑</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="deleteStatisticsParamiter()" th:if="${session.onlineUserPower<2}">删除</a>
        </div>
        <div id="dg_add_edit_statisticsParamiter" class="easyui-dialog" style="width:860px;height: 600px;" data-options="closed:true,modal:true,border:'thin',buttons:'#dlg_statisticsParamiter_buttons'">
            <form id="fm_add_edit_statisticsParamiter" method="post" novalidate style="margin:0;padding:20px 50px">
                <h4 style="text-align: center;">统计参数信息</h4>
                <input type="text" name="paramiterId" hidden="hidden">
                <table id="addTable" width="100%">
                    <tr>
                        <td>年级名称:</td>
                        <td>
                            <select id="gradeName" name="gradeName"  class="easyui-combobox" style="width: 230px;height: 30px;" data-options="required:true,missingMessage:'请选择年级',editable:false" >
                                <option th:each="grade : ${session.grades}"  th:value="${grade.gradeName}" th:text="${grade.gradeName}"></option>
                            </select>
                        </td>
                        <td>学期名称:</td>
                        <td>
                            <select id="semesterName" name="semesterName"  class="easyui-combobox" style="width: 230px;height: 30px;" data-options="required:true,missingMessage:'请选择学期',editable:false" >
                                <option th:each="semester : ${session.semesters}"  th:value="${semester.semesterName}" th:text="${semester.semesterName}"></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>考试名称:</td>
                        <td>
                            <select name="examName" id="add_ExamName" class="easyui-combobox" style="width: 230px;height: 30px;" data-options="required:true,missingMessage:'请选择考试名称',editable:false">
                                <option th:each="exam : ${session.exams}"  th:value="${exam.examName}" th:text="${exam.examName}"></option>
                            </select>
                        </td>
                        <td>类别名称:</td>
                        <td>
                            <select name="categoryName" id="categoryName" class="easyui-combobox" style="width: 230px;height: 30px;" data-options="required:true,missingMessage:'请选择类别名称',editable:false">
                                <option th:each="category : ${session.categorys}"  th:value="${category.categoryName}" th:text="${category.categoryName}"></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>一本联招线:</td><td><input id="oneNumber"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="oneNumber"  /></td>
                        <td>二本普高线:</td><td><input id="twoNumber" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="twoNumber"  /></td>
                    </tr>
                    <tr>
                        <td>语文差生率分数线:</td><td><input id="chineseBad" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="chineseBad" data-options="missingMessage:'请填写性别'"  /></td>
                        <td>语文及格率分数线:</td><td><input id="chineseGood"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="chineseGood" data-options=" missingMessage:'请填写民族'"  /></td>
                    </tr>
                    <tr>
                        <td>语文良好率分数线:</td><td><input id="chineseBetter"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="chineseBetter"  /></td>
                        <td>语文优生率分数线:</td><td><input id="chineseBest" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="chineseBest"  /></td>
                    </tr>
                    <tr>
                        <td>数学差生率分数线:</td><td><input id="mathsBad" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="mathsBad"  /></td>
                        <td>数学及格率分数线:</td><td><input id="mathsGood"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="mathsGood"  /></td>
                    </tr>
                    <tr>
                        <td>数学良好率分数线:</td><td><input id="mathsBetter" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="mathsBetter" /></td>
                        <td>数学优生率分数线:</td><td><input id="mathsBest" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="mathsBest" /></td>
                    </tr>
                    <tr>
                        <td>英语差生率分数线:</td><td><input id="englishBad"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="englishBad"  /></td>
                        <td>英语及格率分数线:</td><td><input id="englishGood"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="englishGood"   /></td>
                    </tr>
                    <tr>
                        <td>英语良好率分数线:</td><td><input id="englishBetter"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="englishBetter"  /></td>
                        <td>英语优生率分数线:</td><td><input id="englishBest"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="englishBest"   /></td>
                    </tr>
                    <tr>
                        <td>物理差生率分数线:</td><td><input id="physicsBad"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="physicsBad"  /></td>
                        <td>物理及格率分数线:</td><td><input id="physicsGood"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="physicsGood"  /></td>
                    </tr>
                    <tr>
                        <td>物理良好率分数线:</td><td><input id="physicsBetter"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="physicsBetter"  /></td>
                        <td>物理优生率分数线:</td><td><input id="physicsBest"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="physicsBest"  /></td>
                    </tr>
                    <tr>
                        <td>历史差生率分数线:</td><td><input id="historyBad"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="historyBad"   /></td>
                        <td>历史及格率分数线:</td><td><input id="historyGood" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="historyGood"   /></td>
                    </tr>
                    <tr>
                        <td>历史良好率分数线:</td><td><input id="historyBetter" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="historyBetter"  /></td>
                        <td>历史优生率分数线:</td><td><input id="historyBest" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="historyBest"  /></td>
                    </tr>
                    <tr>
                        <td>化学差生率分数线:</td><td><input id="chemistryBad" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="chemistryBad"  /></td>
                        <td>化学及格率分数线:</td><td><input id="chemistryGood" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="chemistryGood" /></td>
                    </tr>
                    <tr>
                        <td>化学良好率分数线:</td><td><input id="chemistryBetter" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="chemistryBetter"  /></td>
                        <td>化学优生率分数线:</td><td><input id="chemistryBest" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="chemistryBest" /></td>
                    </tr>
                    <tr >
                        <td>生物差生率分数线:</td><td><input id="biologyBad" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="biologyBad"  /></td>
                        <td>生物及格率分数线:</td><td><input id="biologyGood"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="biologyGood"  /></td>
                    </tr>
                    <tr >
                        <td>生物良好率分数线:</td><td><input id="biologyBetter" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="biologyBetter"  /></td>
                        <td>生物优生率分数线:</td><td><input id="biologyBest"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="biologyBest"  /></td>
                    </tr>
                    <tr>
                        <td>政治差生率分数线:</td><td><input id="politicsBad"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="politicsBad"  /></td>
                        <td>政治及格率分数线:</td><td><input id="politicsGood" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="politicsGood"  /></td>
                    </tr>
                    <tr>
                        <td>政治良好率分数线:</td><td><input id="politicsBetter"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="politicsBetter"  /></td>
                        <td>政治优生率分数线:</td><td><input id="politicsBest" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="politicsBest" /></td>
                    </tr>
                    <tr>
                        <td>地理差生率分数线:</td><td><input id="geographyBad"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="geographyBad"  /></td>
                        <td>地理及格率分数线:</td><td><input id="geographyGood" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="geographyGood" /></td>
                    </tr>
                    <tr>
                        <td>地理良好率分数线:</td><td><input id="geographyBetter"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="geographyBetter"  /></td>
                        <td>地理优生率分数线:</td><td><input id="geographyBest" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="geographyBest" /></td>
                    </tr>
                    <tr>
                        <td>体育差生率分数线:</td><td><input id="sportsBad"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="sportsBad"  /></td>
                        <td>体育及格率分数线:</td><td><input id="sportsGood" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="sportsGood" /></td>
                    </tr>
                    <tr>
                        <td>体育良好率分数线:</td><td><input id="sportsBetter"  class="easyui-textbox" style="width: 230px; height: 30px;" type="text" name="sportsBetter"  /></td>
                        <td>体育优生率分数线:</td><td><input id="sportsBest" style="width: 230px; height: 30px;" class="easyui-textbox" type="text" name="sportsBest" /></td>
                    </tr>
                </table>
            </form>
        </div>
        <div id="dlg_statisticsParamiter_buttons">
            <a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="saveStatisticsParamiter()" style="width:90px">保存</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dg_add_edit_statisticsParamiter').dialog('close')" style="width:90px">取消</a>
        </div>
    </div>
    <div title="学生管理" style="padding:2px">
        <table id="dg_student" style="width:100%;height:100%">

        </table>
        <div id="toolbar_student">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newStudent()" th:if="${session.onlineUserPower<3}">新增</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editStudent()" th:if="${session.onlineUserPower<3}">编辑</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="deleteStudent()" th:if="${session.onlineUserPower<2}">删除</a>
            <input id="studentName" name="studentName" class="easyui-textbox" style="width:110px" data-options="prompt:'输入学生姓名'">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="doSearchStudent()">搜索</a>
        </div>
        <div id="dg_add_editStudent" class="easyui-dialog" style="width:400px" data-options="closed:true,modal:true,border:'thin',buttons:'#dlg_student_buttons'">
            <form id="fm_add_editStudent" method="post" novalidate style="margin:0;padding:20px 50px">
                <h3 style="text-align: center;">学生信息</h3>
                <div style="margin-bottom:10px">
                    <input name="studentIdCard" id="studentIdCard" class="easyui-textbox"
                           data-options="required:true,missingMessage:'请填写学生身份证号'" label="学生身份证号:" style="width:100%;">
                </div>
                <div style="margin-bottom:10px">
                    <input name="studentName" class="easyui-textbox" data-options="required:true,missingMessage:'请填写学生姓名'"
                           label="学生姓名:" style="width:100%">
                </div>
                <div style="margin-bottom:10px">
                    <select class="easyui-combobox" name="gender" label="选择性别:" style="width:295px;" autocomplete="off">
                        <option value="男">男</option>
                        <option value="女">女</option>
                    </select>
                </div>
                <div style="margin-bottom:10px">
                    <input class="easyui-textbox" name="phone" label="电话:" style="width:295px;" autocomplete="off">
                </div>
                <div style="margin-bottom:10px">
                    <input class="easyui-textbox" name="password" label="登录密码:" style="width:295px;" data-options="required:true,missingMessage:'请填写密码'" autocomplete="off">
                </div>
                <div style="margin-bottom:10px">
                    <input class="easyui-textbox" name="origin" label="应届/往届:" style="width:295px;" autocomplete="off">
                </div>

            </form>
        </div>
        <div id="dlg_student_buttons">
            <a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="saveStudent()" style="width:90px">保存</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dg_add_editStudent').dialog('close')" style="width:90px">取消</a>
        </div>
    </div>

</div>

<script type="text/javascript" th:inline="none">
    $(function () {
        //分页参数
        let pageParam = {
            pageSize: 30,							//每页显示的记录条数，默认为10
            pageList: [10, 20, 30, 50, 100],	//可以设置每页记录条数的列表
            beforePageText: '第',				//页数文本框前显示的汉字
            afterPageText: '页    共 {pages} 页',
            displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录',
        }
        //教师信息显示
        $("#dg_teacher").datagrid({
            url: "getAllTeachers?t=" + new Date().getTime(),
            toolbar: "#toolbar",
            pagination: true,
            pageSize: 30,
            rownumbers: true,
            fitColumns: true,
            singleSelect: false,
            fit: true,
            columns: [[
                {field: 'chk', checkbox: true, width: 50},
                {field: 'teacherIdCard', title: '身份证号', align:'center',width: 150, sortable: true},
                {field: 'teacherName', title: '姓名', align:'center', width: 100, sortable: true},
                {field: 'gender', title: '性别', align:'center', width: 100},
                {field: 'phone', title: '电话', align:'center', width: 100},
                {field: 'password', title: '登陆密码', align:'center', width: 100},
                {field: 'roleName', title: '角色', align:'center', width: 100}
            ]]
        });
        let pageTeacher = $("#dg_teacher").datagrid("getPager");
        $(pageTeacher).pagination(pageParam);
        //教师 任教 信息显示
        $("#dg_teach").datagrid({
            url: "getAllTeachInfo?t=" + new Date().getTime(),
            toolbar: "#toolbar_teach",
            pagination: true,
            pageSize: 30,
            rownumbers: true,
            fitColumns: true,
            singleSelect: false,
            fit: true,
            columns: [[
                {field: 'chk', checkbox: true, width: 50},
                {field: 'teachId', title: '编号', align:'center', hidden:true,width: 50, sortable: true},
                {field: 'teacherIdCard', title: '教师身份证号',align:'center', width: 150},
                {field: 'teacherName', title: '教师姓名', align:'center',width: 150},
                {field: 'gradeName', title: '任教年级', align:'center',width: 100},
                {field: 'semesterName', title: '任教学期',align:'center', width: 100},
                {field: 'teamName', title: '任教班级', align:'center',width: 100},
                {field: 'courseEnName', title: '任教学科', align:'center',width: 100},
                {field: 'isVariant', title: '是否班主任', align:'center',width: 100}
            ]]
        });
        let pageTeach = $("#dg_teach").datagrid("getPager");
        $(pageTeach).pagination(pageParam);
        //学生信息显示
        $("#dg_student").datagrid({
            url: "getAllStudents?t=" + new Date().getTime(),
            toolbar: "#toolbar_student",
            pagination: true,
            pageSize: 30,
            rownumbers: true,
            fitColumns: true,
            singleSelect: false,
            fit: true,
            columns: [[
                {field: 'chk', checkbox: true, width: 50},
                {field: 'studentIdCard', title: '身份证号', align:'center',width: 150, sortable: true},
                {field: 'studentName', title: '姓名', align:'center', width: 100, sortable: true},
                {field: 'gender', title: '性别', align:'center', width: 100},
                {field: 'phone', title: '电话', align:'center', width: 100},
                {field: 'password', title: '登陆密码', align:'center', width: 100},
                {field: 'origin', title: '往届/应届', align:'center', width: 100}
            ]]
        });
        let pageStudent = $("#dg_student").datagrid("getPager");
        $(pageStudent).pagination(pageParam);

        //管理员信息显示
        $("#dg_adminuser").datagrid({
            url: "getAllAdminuser?t=" + new Date().getTime(),
            toolbar: "#toolbar_adminuser",
            pagination: true,
            pageSize: 30,
            rownumbers: true,
            fitColumns: true,
            singleSelect: false,
            fit: true,
            columns: [[
                {field: 'chk', checkbox: true, width: 50},
                {field: 'adminid', title: 'id号', align:'center',hidden:true, width: 150, sortable: true},
                {field: 'adminLoginName', title: '登录账号', align:'center', width: 100, sortable: true},
                {field: 'adminPassword', title: '登录密码', align:'center', width: 100},
                {field: 'adminTrueName', title: '真实姓名', align:'center', width: 100},
                {field: 'gradeName', title: '年级主任所在年级', align:'center', width: 100},
                {field: 'power', title: '权限', align:'center', width: 100}
            ]]
        });
        let pageAdminuser = $("#dg_adminuser").datagrid("getPager");
        $(pageAdminuser).pagination(pageParam);

        //考试信息显示
        $("#dg_exam").datagrid({
            url: "getAllExams?t=" + new Date().getTime(),
            toolbar: "#toolbar_exam",
            pagination: true,
            pageSize: 30,
            rownumbers: true,
            fitColumns: true,
            singleSelect: false,
            fit: true,
            columns: [[
                {field: 'chk', checkbox: true, width: 50},
                {field: 'examId', title: '编号', align:'center',width: 150,hidden:true},
                {field: 'gradeName', title: '年级名称', align:'center', width: 100},
                {field: 'semesterName', title: '学期名称', align:'center', width: 100},
                {field: 'examName', title: '考试名称', align:'center', width: 100},
                {field: 'courseName', title: '考试科目', align:'center', width: 180},
                {field: 'examScore', title: '科目总分', align:'center', width: 100}
            ]]
        });
        let pageExam = $("#dg_exam").datagrid("getPager");
        $(pageExam).pagination(pageParam);

        //统计参数信息显示
        $("#dg_statisticsParamiter").datagrid({
            url: "getAllStatisticsParamiter?t=" + new Date().getTime(),
            toolbar: "#toolbar_statisticsParamiter",
            pagination: true,
            pageSize: 30,
            rownumbers: true,
            fitColumns: false,
            singleSelect: false,
            fit: true,
            columns: [[
                {field: 'chk', checkbox: true, width: 50},
                {field: 'paramiterId', title: '编号', align:'center',width: 150,hidden:true},
                {field: 'gradeName', title: '年级名称', align:'center', width: 80},
                {field: 'semesterName', title: '学期名称', align:'center', width: 90},
                {field: 'examName', title: '考试名称', align:'center', width: 200},
                {field: 'categoryName', title: '类别名称', align:'center', width: 60},
                {field: 'oneNumber', title: '一本联招线', align:'center', width: 80},
                {field: 'twoNumber', title: '二本普高线', align:'center', width: 80},
                {field: 'chineseBad', title: '语文差生率分数线', align:'center', width: 120},
                {field: 'chineseGood', title: '语文及格率分数线', align:'center', width: 120},
                {field: 'chineseBetter', title: '语文良好率分数线', align:'center', width: 120},
                {field: 'chineseBest', title: '语文优生率分数线', align:'center', width: 120},
                {field: 'mathsBad', title: '数学差生率分数线', align:'center', width: 120},
                {field: 'mathsGood', title: '数学及格率分数线', align:'center', width: 120},
                {field: 'mathsBetter', title: '数学良好率分数线', align:'center', width: 120},
                {field: 'mathsBest', title: '数学优生率分数线', align:'center', width: 120},
                {field: 'englishBad', title: '英语差生率分数线', align:'center', width: 120},
                {field: 'englishGood', title: '英语及格率分数线', align:'center', width: 120},
                {field: 'englishBetter', title: '英语良好率分数线', align:'center', width: 120},
                {field: 'englishBest', title: '英语优生率分数线', align:'center', width: 120},
                {field: 'physicsBad', title: '物理差生率分数线', align:'center', width: 120},
                {field: 'physicsGood', title: '物理及格率分数线', align:'center', width: 120},
                {field: 'physicsBetter', title: '物理良好率分数线', align:'center', width: 120},
                {field: 'physicsBest', title: '物理优生率分数线', align:'center', width: 120},
                {field: 'historyBad', title: '历史差生率分数线', align:'center', width: 120},
                {field: 'historyGood', title: '历史及格率分数线', align:'center', width: 120},
                {field: 'historyBetter', title: '历史良好率分数线', align:'center', width: 120},
                {field: 'historyBest', title: '历史优生率分数线', align:'center', width: 120},
                {field: 'chemistryBad', title: '化学差生率分数线', align:'center', width: 120},
                {field: 'chemistryGood', title: '化学及格率分数线', align:'center', width: 120},
                {field: 'chemistryBetter', title: '化学良好率分数线', align:'center', width: 120},
                {field: 'chemistryBest', title: '化学优生率分数线', align:'center', width: 120},
                {field: 'biologyBad', title: '生物差生率分数线', align:'center', width: 120},
                {field: 'biologyGood', title: '生物及格率分数线', align:'center', width: 120},
                {field: 'biologyBetter', title: '生物良好率分数线', align:'center', width: 120},
                {field: 'biologyBest', title: '生物优生率分数线', align:'center', width: 120},
                {field: 'politicsBad', title: '政治差生率分数线', align:'center', width: 120},
                {field: 'politicsGood', title: '政治及格率分数线', align:'center', width: 120},
                {field: 'politicsBetter', title: '政治良好率分数线', align:'center', width: 120},
                {field: 'politicsBest', title: '政治优生率分数线', align:'center', width: 120},
                {field: 'geographyBad', title: '地理差生率分数线', align:'center', width: 120},
                {field: 'geographyGood', title: '地理及格率分数线', align:'center', width: 120},
                {field: 'geographyBetter', title: '地理良好率分数线', align:'center', width: 120},
                {field: 'geographyBest', title: '地理优生率分数线', align:'center', width: 120},
                {field: 'sportsBad', title: '体育差生率分数线', align:'center', width: 120},
                {field: 'sportsGood', title: '体育及格率分数线', align:'center', width: 120},
                {field: 'sportsBetter', title: '体育良好率分数线', align:'center', width: 120},
                {field: 'sportsBest', title: '体育优生率分数线', align:'center', width: 120}
            ]]
        });
        let pageStatisticsParamiter = $("#dg_statisticsParamiter").datagrid("getPager");
        $(pageStatisticsParamiter).pagination(pageParam);

        //年级信息显示
        $("#dg_grade").datagrid({
            url: "getAllGrades?t=" + new Date().getTime(),
            toolbar: "#toolbar_grade",
            pagination: true,
            pageSize: 30,
            rownumbers: true,
            fitColumns: false,
            singleSelect: false,
            fit: true,
            columns: [[
                {field: 'chk', checkbox: true, width: 50},
                {field: 'gradeId', title: '编号', align:'center',width: 150,hidden:true},
                {field: 'gradeName', title: '年级名称', align:'center', width: 100},
                {field: 'gradeDatatableName', title: '年级数据库表名称', align:'center', width: 100,readonly:true}
            ]]
        });
        let pageGrade = $("#dg_grade").datagrid("getPager");
        $(pageExam).pagination(pageParam);


    });

    //身份证验证
    let Wi = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1];    // 加权因子
    let ValideCode = [1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2];            // 身份证验证位值.10代表X
    function IdCardValidate(idCard) {
        idCard = trim(idCard.replace(/ /g, ""));               //去掉字符串头尾空格
        if (idCard.length != 18) {
            hsycms.alert('alert', "身份证号不是18位，请重新输入!", function () {
                hsycms.close('alert');
            });
            return false;
        } else {
            let a_idCard = idCard.split("");                // 得到身份证数组
            if (isValidityBrithBy18IdCard(idCard) && isTrueValidateCodeBy18IdCard(a_idCard)) {   //进行18位身份证的基本验证和第18位的验证
                return true;
            } else {
                hsycms.alert('alert', "身份证号错误，请重新输入!", function () {
                    hsycms.close('alert');
                });
                return false;
            }
        }
    }

    /**   判断身份证号码为18位时最后的验证位是否正确       */
    function isTrueValidateCodeBy18IdCard(a_idCard) {
        let sum = 0;                             // 声明加权求和变量
        if (a_idCard[17].toLowerCase() == 'x') {
            a_idCard[17] = 10;                    // 将最后位为x的验证码替换为10方便后续操作
        }
        for (let i = 0; i < 17; i++) {
            sum += Wi[i] * a_idCard[i];            // 加权求和
        }
        let valCodePosition = sum % 11;                // 得到验证码所位置
        if (a_idCard[17] == ValideCode[valCodePosition]) {
            return true;
        } else {
            return false;
        }
    }

    /**    验证18位数身份证号码中的生日是否是有效生日        */
    function isValidityBrithBy18IdCard(idCard18) {
        let year = idCard18.substring(6, 10);
        // if((new Date().getFullYear())-parseInt(year)>=16){        //年龄大于16岁
        //     return false;
        // }
        let month = idCard18.substring(10, 12);
        let day = idCard18.substring(12, 14);
        let temp_date = new Date(year, parseFloat(month) - 1, parseFloat(day));
        // 这里用getFullYear()获取年份，避免千年虫问题
        if (temp_date.getFullYear() != parseFloat(year)
            || temp_date.getMonth() != parseFloat(month) - 1
            || temp_date.getDate() != parseFloat(day)) {
            return false;
        } else {
            return true;
        }
    }

    //去掉字符串头尾空格
    function trim(str) {
        return str.replace(/(^\s*)|(\s*$)/g, "");
    }

    //按钮请求url
    let url;
    //新增考试信息
    function newExam() {
        $('#dg_add_edit_exam').dialog('open').dialog('center').dialog('setTitle', '新增考试信息');
        $('#fm_add_edit_exam').form('clear');
        $("#courseName").textbox('setValue','chinese|maths|english|physics|history|chemistry|biology|politics|geography');
        url = 'newAddExam';
    }
    //新增或修改 考试信息
    function saveExam() {
        //窗体校验
        if (!$("#fm_add_edit_exam").form('validate')) {
            return;
        }
        let regPos = /^\d+(\.\d+)?$/;   //非负浮点数
        let examExamScore = $("#examExamScore").val();
        if(!regPos.test(examExamScore)){
            hsycms.alert('alert', "输入的总分不是数字！", function () {
                hsycms.close('alert');
            });
            return false;
        }
        let data = $("#fm_add_edit_exam").serialize();
        $.ajax({
            type: "post",
            url: url,
            data: data,
            dataType: 'json',
            success: function (res) {
                if (res.type == "success") {
                    $.messager.alert("消息提醒", res.msg, "info");
                    $('#dg_add_edit_exam').dialog('close');
                    $("#dg_exam").datagrid("reload");
                } else {
                    $.messager.alert("消息提醒", res.msg, "warning");
                }
            }
        });
    }
    //编辑 考试信息
    function editExam() {
        let row = $("#dg_exam").datagrid('getSelections');
        if (row.length != 1) {
            hsycms.alert('alert', "请选择一行数据！", function () {
                hsycms.close('alert');
            });
            return false;
        }
        $('#dg_add_edit_exam').dialog('open').dialog('center').dialog('setTitle', '编辑考试信息');
        $('#fm_add_edit_exam').form('load', row[0]);
        url = 'editExam';
    }
    //删除 考试信息
    function deleteExam() {
        let selectRows = $("#dg_exam").datagrid("getSelections");
        let selectLength = selectRows.length;
        if(selectLength == 0){
            $.messager.alert("消息提醒", "请选择数据进行删除!", "warning");
        } else{
            let idArray = [];
            $(selectRows).each(function(i, row){
                idArray[i] = row.examId;
            });

            $.messager.confirm("消息提醒", "确定删除该信息？", function(r){
                if(r){
                    $.ajax({
                        type: "post",
                        url: "deleteExam",
                        data: {ids: idArray},
                        dataType:'json',
                        success: function(ret){
                            if(ret.type == "success"){
                                $.messager.alert("消息提醒","删除成功!","info");
                                //刷新表格
                                $("#dg_exam").datagrid("reload");
                                $("#dg_exam").datagrid("uncheckAll");
                            } else{
                                $.messager.alert("消息提醒",data.msg,"warning");
                            }
                        }
                    });
                }
            });
        }
    }

    //新增统计参数信息
    function newStatisticsParamiter() {
        $('#dg_add_edit_statisticsParamiter').dialog('open').dialog('center').dialog('setTitle', '新增考试信息');
        $('#fm_add_edit_statisticsParamiter').form('clear');
        //$("#gradeName").combobox('setValues',"请选择年级");
        //$("#semesterName").combobox('setValues',"请选择学期");
        //$("#add_ExamName").combobox('setValues',"请选择考试名称");
        //$("#categoryName").combobox('setValues',"请选择类别名称");
        $("#oneNumber").textbox('setValue',"0");
        $("#twoNumber").textbox('setValue',"0");
        $("#chineseBad").textbox('setValue',"60");
        $("#chineseGood").textbox('setValue',"90");
        $("#chineseBetter").textbox('setValue',"105");
        $("#chineseBest").textbox('setValue',"120");

        $("#mathsBad").textbox('setValue',"60");
        $("#mathsGood").textbox('setValue',"90");
        $("#mathsBetter").textbox('setValue',"105");
        $("#mathsBest").textbox('setValue',"120");

        $("#englishBad").textbox('setValue',"60");
        $("#englishGood").textbox('setValue',"90");
        $("#englishBetter").textbox('setValue',"105");
        $("#englishBest").textbox('setValue',"120");

        $("#physicsBad").textbox('setValue',"40");
        $("#physicsGood").textbox('setValue',"60");
        $("#physicsBetter").textbox('setValue',"70");
        $("#physicsBest").textbox('setValue',"80");

        $("#historyBad").textbox('setValue',"40");
        $("#historyGood").textbox('setValue',"60");
        $("#historyBetter").textbox('setValue',"70");
        $("#historyBest").textbox('setValue',"80");

        $("#chemistryBad").textbox('setValue',"40");
        $("#chemistryGood").textbox('setValue',"60");
        $("#chemistryBetter").textbox('setValue',"70");
        $("#chemistryBest").textbox('setValue',"80");

        $("#biologyBad").textbox('setValue',"40");
        $("#biologyGood").textbox('setValue',"60");
        $("#biologyBetter").textbox('setValue',"70");
        $("#biologyBest").textbox('setValue',"80");

        $("#politicsBad").textbox('setValue',"40");
        $("#politicsGood").textbox('setValue',"60");
        $("#politicsBetter").textbox('setValue',"70");
        $("#politicsBest").textbox('setValue',"80");

        $("#geographyBad").textbox('setValue',"40");
        $("#geographyGood").textbox('setValue',"60");
        $("#geographyBetter").textbox('setValue',"70");
        $("#geographyBest").textbox('setValue',"80");
        $("#sportsBad").textbox('setValue',"0");
        $("#sportsGood").textbox('setValue',"0");
        $("#sportsBetter").textbox('setValue',"0");
        $("#sportsBest").textbox('setValue',"0");
        url = 'newAddStatisticsParamiter';
    }
    //新增或修改 统计参数信息
    function saveStatisticsParamiter() {
        //窗体校验
        if (!$("#fm_add_edit_statisticsParamiter").form('validate')) {
            return;
        }

        let data = $("#fm_add_edit_statisticsParamiter").serialize();
        $.ajax({
            type: "post",
            url: url,
            data: data,
            dataType: 'json',
            success: function (res) {
                if (res.type == "success") {
                    $.messager.alert("消息提醒", res.msg, "info");
                    $('#dg_add_edit_statisticsParamiter').dialog('close');
                    $("#dg_statisticsParamiter").datagrid("reload");
                } else {
                    $.messager.alert("消息提醒", res.msg, "warning");
                }
            }
        });
    }
    //编辑 统计参数信息
    function editStatisticsParamiter() {
        let row = $("#dg_statisticsParamiter").datagrid('getSelections');
        if (row.length != 1) {
            hsycms.alert('alert', "请选择一行数据！", function () {
                hsycms.close('alert');
            });
            return false;
        }
        $('#dg_add_edit_statisticsParamiter').dialog('open').dialog('center').dialog('setTitle', '编辑统计参数信息');
        $('#fm_add_edit_statisticsParamiter').form('load', row[0]);
        url = 'addEditStatisticsParamiter';
    }
    //删除 统计参数信息
    function deleteStatisticsParamiter() {
        let selectRows = $("#dg_statisticsParamiter").datagrid("getSelections");
        let selectLength = selectRows.length;
        if(selectLength == 0){
            $.messager.alert("消息提醒", "请选择数据进行删除!", "warning");
        } else{
            let idArray = [];
            $(selectRows).each(function(i, row){
                idArray[i] = row.paramiterId;
            });

            $.messager.confirm("消息提醒", "确定删除该信息？", function(r){
                if(r){
                    $.ajax({
                        type: "post",
                        url: "deleteStatisticsParamiter",
                        data: {ids: idArray},
                        dataType:'json',
                        success: function(ret){
                            if(ret.type == "success"){
                                $.messager.alert("消息提醒","删除成功!","info");
                                //刷新表格
                                $("#dg_statisticsParamiter").datagrid("reload");
                                $("#dg_statisticsParamiter").datagrid("uncheckAll");
                            } else{
                                $.messager.alert("消息提醒",data.msg,"warning");
                            }
                        }
                    });
                }
            });
        }
    }

    //新增 管理员
    function newAdminUser() {
        $('#dg_add_edit_adminuser').dialog('open').dialog('center').dialog('setTitle', '新增管理员');
        $('#fm_add_edit_adminuser').form('clear');
        url = 'newAddAdminUser';
    }
    //新增或修改 管理员
    function saveAdminUser() {
        //窗体校验
        if (!$("#fm_add_edit_adminuser").form('validate')) {
            return;
        }
        let regPos = /^\d+(\d+)?$/;   //整数
        let power = $("#power").val();
        if(!regPos.test(power)){
            hsycms.alert('alert', "输入的权限值不是数字！", function () {
                hsycms.close('alert');
            });
            return false;
        }
        let data = $("#fm_add_edit_adminuser").serialize();
        $.ajax({
            type: "post",
            url: url,
            data: data,
            dataType: 'json',
            success: function (res) {
                if (res.type == "success") {
                    $.messager.alert("消息提醒", res.msg, "info");
                    $('#dg_add_edit_adminuser').dialog('close');
                    $("#dg_adminuser").datagrid("reload");
                } else {
                    $.messager.alert("消息提醒", res.msg, "warning");
                }
            }
        });
    }
    //编辑管理员
    function editAdminUser() {
        let row = $("#dg_adminuser").datagrid('getSelections');
        if (row.length != 1) {
            hsycms.alert('alert', "请选择一行数据！", function () {
                hsycms.close('alert');
            });
            return false;
        }
        $('#dg_add_edit_adminuser').dialog('open').dialog('center').dialog('setTitle', '编辑管理员');
        $('#fm_add_edit_adminuser').form('load', row[0]);
        url = 'editAdminUser';
    }
    //删除管理员
    function deleteAdminUser() {
        let selectRows = $("#dg_adminuser").datagrid("getSelections");
        let selectLength = selectRows.length;
        if(selectLength == 0){
            $.messager.alert("消息提醒", "请选择数据进行删除!", "warning");
        } else{
            let adminidArray = [];              //获取所有选择行的adminid号放在数组里面
            $(selectRows).each(function(i, row){
                adminidArray[i] = row.adminid;
            });
            $.messager.confirm("消息提醒", "确定删除管理员信息？", function(r){
                if(r){
                    $.ajax({
                        type: "post",
                        url: "deleteAdminUser",
                        data: {ids: adminidArray},
                        dataType:'json',
                        success: function(ret){
                            if(ret.type == "success"){
                                $.messager.alert("消息提醒","删除成功!","info");
                                //刷新表格
                                $("#dg_adminuser").datagrid("reload");
                                $("#dg_adminuser").datagrid("uncheckAll");
                            } else{
                                $.messager.alert("消息提醒",data.msg,"warning");
                            }
                        }
                    });
                }
            });
        }
    }

    //新增学生
    function newStudent() {
        $('#dg_add_editStudent').dialog('open').dialog('center').dialog('setTitle', '新增学生');
        $('#fm_add_editStudent').form('clear');
        url = 'newAddStudent';
    }
    //新增或修改 学生
    function saveStudent() {
        //窗体校验
        if (!$("#fm_add_editStudent").form('validate')) {
            return;
        }
        //校验身份证号
        // let studentIdCard = $("#studentIdCard").val();
        // if (!IdCardValidate(studentIdCard)) {
        //     return;
        // }
        let data = $("#fm_add_editStudent").serialize();
        $.ajax({
            type: "post",
            url: url,
            data: data,
            dataType: 'json',
            success: function (res) {
                if (res.type == "success") {
                    $.messager.alert("消息提醒", res.msg, "info");
                    $('#dg_add_editStudent').dialog('close');
                    $("#dg_student").datagrid("reload");
                } else {
                    $.messager.alert("消息提醒", res.msg, "warning");
                }
            }
        });
    }
    //编辑学生信息
    function editStudent() {
        let row = $("#dg_student").datagrid('getSelections');
        if (row.length != 1) {
            hsycms.alert('alert', "请选择一行数据！", function () {
                hsycms.close('alert');
            });
            return false;
        }
        $('#dg_add_editStudent').dialog('open').dialog('center').dialog('setTitle', '编辑学生');
        $('#fm_add_editStudent').form('load', row[0]);
        url = 'editStudent';
    }
    //删除学生
    function deleteStudent() {
        let selectRows = $("#dg_student").datagrid("getSelections");
        let selectLength = selectRows.length;
        if(selectLength == 0){
            $.messager.alert("消息提醒", "请选择数据进行删除!", "warning");
        } else{
            let studentIdCard = []; //获取所有选择行的教师身份证号放在数组里面
            $(selectRows).each(function(i, row){
                studentIdCard[i] = row.studentIdCard;
            });

            $.messager.confirm("消息提醒", "确定删除学生信息？", function(r){
                if(r){
                    $.ajax({
                        type: "post",
                        url: "deleteStudent",
                        data: {ids: studentIdCard},
                        dataType:'json',
                        success: function(ret){
                            if(ret.type == "success"){
                                $.messager.alert("消息提醒","删除成功!","info");
                                //刷新表格
                                $("#dg_student").datagrid("reload");
                                $("#dg_student").datagrid("uncheckAll");
                            } else{
                                $.messager.alert("消息提醒",data.msg,"warning");
                            }
                        }
                    });
                }
            });
        }
    }
    //模糊搜索学生
    function doSearchStudent() {
        $("#dg_student").datagrid("load", {
            "studentName": $("#studentName").val()
        });
    }

    //新增教师
    function newTeacher() {
        $('#dg_add_editTeacher').dialog('open').dialog('center').dialog('setTitle', '新增教师');
        $('#fm_add_editTeacher').form('clear');
        url = 'newAddTeacher';
    }
    //编辑教师信息
    function editTeacher() {
        let row = $("#dg_teacher").datagrid('getSelections');
        if (row.length != 1) {
            hsycms.alert('alert', "请选择一行数据！", function () {
                hsycms.close('alert');
            });
            return false;
        }
        $('#dg_add_editTeacher').dialog('open').dialog('center').dialog('setTitle', '编辑教师');
        $('#fm_add_editTeacher').form('load', row[0]);
        url = 'editTeacher';
    }
    //新增或修改 教师
    function saveTeacher() {
        //教师窗体校验
        if (!$("#fm_add_editTeacher").form('validate')) {
            return;
        }
        let regPos = /^\d+(\d+)?$/;   //整数
        let rolenameid = $("#rolenameid").val();
        if(rolenameid.length>0 && !regPos.test(rolenameid)){
            hsycms.alert('alert', "输入的角色不是数字！", function () {
                hsycms.close('alert');
            });
            return false;
        }
        //校验身份证号
        // let teacherIdCard = $("#teacherIdCard").val();
        // if (!IdCardValidate(teacherIdCard)) {
        //     return;
        // }
        let data = $("#fm_add_editTeacher").serialize();
        $.ajax({
            type: "post",
            url: url,
            data: data,
            dataType: 'json',
            success: function (res) {
                if (res.type == "success") {
                    $.messager.alert("消息提醒", res.msg, "info");
                    $('#dg_add_editTeacher').dialog('close');
                    $("#dg_teacher").datagrid("reload");
                } else {
                    $.messager.alert("消息提醒", res.msg, "warning");
                }
            }
        });
    }
    //删除教师
    function deleteTeacher() {
        let selectRows = $("#dg_teacher").datagrid("getSelections");
        let selectLength = selectRows.length;
        if(selectLength == 0){
            $.messager.alert("消息提醒", "请选择数据进行删除!", "warning");
        } else{
            let teacherIdCard = []; //获取所有选择行的教师身份证号放在数组里面
            $(selectRows).each(function(i, row){
                teacherIdCard[i] = row.teacherIdCard;
            });

            $.messager.confirm("消息提醒", "确定删除教师信息？", function(r){
                if(r){
                    $.ajax({
                        type: "post",
                        url: "deleteTeacher",
                        data: {ids: teacherIdCard},
                        dataType:'json',
                        success: function(ret){
                            if(ret.type == "success"){
                                $.messager.alert("消息提醒","删除成功!","info");
                                //刷新表格
                                $("#dg_teacher").datagrid("reload");
                                $("#dg_teacher").datagrid("uncheckAll");
                            } else{
                                $.messager.alert("消息提醒",data.msg,"warning");
                            }
                        }
                    });
                }
            });
        }
    }
    //模糊搜索教师
    function doSearchTeacher() {
        $("#dg_teacher").datagrid("load", {
            "teacherName": $("#teacherName").val()
        });
    }

    //模糊搜索 任教信息
    function doSearchTeachInfo() {
        $("#dg_teach").datagrid("load", {
            "teacherName": $("#teachTeacherName").val()
        });
    }
    //新增任教信息
    function newTeachInfo() {
        $('#dg_add_editTeachInfo').dialog('open').dialog('center').dialog('setTitle', '新增教师任教信息');
        $('#fm_add_editTeachInfo').form('clear');
        url = 'newAddTeachInfo';
    }
    //新增或修改 任教信息
    function saveTeach() {
        //窗体校验
        if (!$("#fm_add_editTeachInfo").form('validate')) {
            return;
        }
        //校验身份证号
        // let teachTeacherIdCard = $("#teachTeacherIdCard").val();
        // if (!IdCardValidate(teachTeacherIdCard)) {
        //     return;
        // }
        let data = $("#fm_add_editTeachInfo").serialize();
        $.ajax({
            type: "post",
            url: url,
            data: data,
            dataType: 'json',
            success: function (res) {
                if (res.type == "success") {
                    $.messager.alert("消息提醒", res.msg, "info");
                    $('#dg_add_editTeachInfo').dialog('close');
                    $("#dg_teach").datagrid("reload");
                } else {
                    $.messager.alert("消息提醒", res.msg, "warning");
                }
            }
        });
    }
    //编辑 任教信息
    function editTeachInfo() {
        let row = $("#dg_teach").datagrid('getSelections');
        if (row.length != 1) {
            hsycms.alert('alert', "请选择一行数据！", function () {
                hsycms.close('alert');
            });
            return false;
        }
        $('#dg_add_editTeachInfo').dialog('open').dialog('center').dialog('setTitle', '编辑任教信息');
        $('#fm_add_editTeachInfo').form('load', row[0]);
        url = 'editTeachInfo';
    }
    //删除 任教信息
    function deleteTeachInfo() {
        let selectRows = $("#dg_teach").datagrid("getSelections");
        let selectLength = selectRows.length;
        if(selectLength == 0){
            $.messager.alert("消息提醒", "请选择数据进行删除!", "warning");
        } else{
            let teachIdArray = [];
            $(selectRows).each(function(i, row){
                teachIdArray[i] = row.teachId;
            });

            $.messager.confirm("消息提醒", "确定删除教师信息？", function(r){
                if(r){
                    $.ajax({
                        type: "post",
                        url: "deleteTeachInfo",
                        data: {ids: teachIdArray},
                        dataType:'json',
                        success: function(ret){
                            if(ret.type == "success"){
                                $.messager.alert("消息提醒","删除成功!","info");
                                //刷新表格
                                $("#dg_teach").datagrid("reload");
                                $("#dg_teach").datagrid("uncheckAll");
                            } else{
                                $.messager.alert("消息提醒",data.msg,"warning");
                            }
                        }
                    });
                }
            });
        }
    }

    //新增年级
    function newGrade() {
        $('#dg_add_edit_grade').dialog('open').dialog('center').dialog('setTitle', '新增年级信息');
        $('#fm_add_edit_grade').form('clear');
        url = 'newAddGrade';
    }
    //保存年级
    function saveGrade() {
        let gradeName=$("#addGradeName").val();
        if(gradeName.length!=6 ){
            hsycms.alert('alert', "输入的年级名称不对！", function () {
                hsycms.close('alert');
            });
            return false;
        }

        let fourdigit = gradeName.substr(1,4);
        let regPos = /^\d+(\d+)?$/;                 //整数
        if(!regPos.test(fourdigit)){
            hsycms.alert('alert', "输入的年级名称格式不对！", function () {
                hsycms.close('alert');
            });
            return false;
        }
        let firstWord = gradeName.trim().substr(0,1);
        let gradeDatatableName;
        if("高"==firstWord ){
            gradeDatatableName="t_g"+gradeName.substr(1,4)+"_score";
        }else if("初"==firstWord){
            gradeDatatableName="t_c"+gradeName.substr(1,4)+"_score";
        }else {
            hsycms.alert('alert', "输入的年级名称格式不对！", function () {
                hsycms.close('alert');
            });
            return false;
        }

        $("#gradeDatatableName").val(gradeDatatableName);
        //窗体校验
        if (!$("#fm_add_edit_grade").form('validate')) {
            return;
        }
        let data = $("#fm_add_edit_grade").serialize();
        $.ajax({
            type: "post",
            url: url,
            data: data,
            dataType: 'json',
            success: function (res) {
                if (res.type == "success") {
                    $.messager.alert("消息提醒", res.msg, "info");
                    $('#dg_add_edit_grade').dialog('close');
                    $("#dg_grade").datagrid("reload");
                } else {
                    $.messager.alert("消息提醒", res.msg, "warning");
                }
            }
        });
    }
    //编辑 年级
    function editGrade() {
        let row = $("#dg_grade").datagrid('getSelections');
        if (row.length != 1) {
            hsycms.alert('alert', "请选择一行数据！", function () {
                hsycms.close('alert');
            });
            return false;
        }
        $('#dg_add_edit_grade').dialog('open').dialog('center').dialog('setTitle', '编辑年级信息');
        $('#fm_add_edit_grade').form('load', row[0]);
        url = 'editGrade';
    }
    //删除 年级
    function deleteGrade() {
        let selectRows = $("#dg_grade").datagrid("getSelections");
        let selectLength = selectRows.length;
        if(selectLength == 0){
            $.messager.alert("消息提醒", "请选择数据进行删除!", "warning");
        } else{
            let idArray = [];
            $(selectRows).each(function(i, row){
                idArray[i] = row.gradeId;
            });

            $.messager.confirm("消息提醒", "确定删除教师信息？", function(r){
                if(r){
                    $.ajax({
                        type: "post",
                        url: "deleteGrade",
                        data: {ids: idArray},
                        dataType:'json',
                        success: function(ret){
                            if(ret.type == "success"){
                                $.messager.alert("消息提醒","删除成功!","info");
                                //刷新表格
                                $("#dg_grade").datagrid("reload");
                                $("#dg_grade").datagrid("uncheckAll");
                            } else{
                                $.messager.alert("消息提醒",data.msg,"warning");
                            }
                        }
                    });
                }
            });
        }
    }

</script>
</body>